package server

import (
	"crypto/tls"
	"time"

	"gitee.com/zfd81/dbrs/server/auth"

	"github.com/opentracing/opentracing-go"
)

// Config for the mysql server.
type Config struct {
	// Protocol for the connection.
	Protocol string
	// Address of the server.
	Address string
	// Auth of the server.
	Auth auth.Auth
	// Tracer to use in the server. By default, a noop tracer will be used if
	// no tracer is provided.
	Tracer opentracing.Tracer
	// Version string to advertise in running server
	Version string
	// ConnReadTimeout is the server's read timeout
	ConnReadTimeout time.Duration
	// ConnWriteTimeout is the server's write timeout
	ConnWriteTimeout   time.Duration
	ConnReadBufferSize int
	// MaxConnections is the maximum number of simultaneous connections that the server will allow.
	MaxConnections uint64
	// TLSConfig is the configuration for TLS on this server. If |nil|, TLS is not supported.
	TLSConfig *tls.Config
	// RequestSecureTransport will require incoming connections to be TLS. Requires non-|nil| TLSConfig.
	RequireSecureTransport bool
}
